 package CurtainDesign;

 import CurtainDesign.utils.CurtainChecker;
 import com.lowagie.text.Chunk;
 import com.lowagie.text.Document;
 import com.lowagie.text.DocumentException;
 import com.lowagie.text.Font;
 import com.lowagie.text.PageSize;
 import com.lowagie.text.Paragraph;
 import com.lowagie.text.Phrase;
 import com.lowagie.text.Rectangle;
 import com.lowagie.text.pdf.BaseFont;
 import com.lowagie.text.pdf.PdfPCell;
 import com.lowagie.text.pdf.PdfPTable;
 import com.lowagie.text.pdf.PdfWriter;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.text.DateFormat;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import javax.swing.JOptionPane;

 public class ResultInfoByPass extends ResultInfo
 {
   private float m_HeaderLength;
   private float m_TrackLength;
   private float m_TopFasciaLength;
   private float m_SideLegHeight;
   private float m_SideFasciaHeight;
   private float m_PoleLength;
   private float m_BeamLength;
   private float m_UpBeamWidth;
   private float m_DownBeamWidth;
   private int m_UpBeamNum;
   private int m_DownBeamNum;
   private float m_VaneLength;
   private int m_VaneNum;
   private float[] m_PullBarLength;
   private float m_DividerLength;
   private int[] m_DividerPos;
   private int m_HingeNum;
   private int m_DoubleHingeNum;
   private int m_VaneBoltNum;
   private int m_TenonNum;
   private float m_TotalArea;
   private int m_PivotKitNum;
   private int m_RollerNum;
   private float m_BoardWidth;
   private float m_BoardHeight;

   public ResultInfoByPass()
   {
     this.m_OrderInfo = CurtainDesign.m_UserMainGUI.GetOrderInfo();
   }

   public boolean Output(String pathfile)
   {
     Output output = new Output();
     return output.OutputToPdfFile(pathfile);
   }

   public void DrawPic()
   {
   }

   public boolean Calculate()
   {
     CalculateRectSimple calculate = new CalculateRectSimple();
     return calculate.Exec();
   }

   public class Output
   {
     public Output()
     {
     }

     public boolean OutputToPdfFile(String filepath)
     {
       Rectangle rectPageSize = new Rectangle(PageSize.A4);
       Document doc = new Document(rectPageSize, 50.0F, 50.0F, 50.0F, 50.0F);
       try
       {
         PdfWriter.getInstance(doc, new FileOutputStream(filepath));

         doc.open();

         OutputFramePage(doc, rectPageSize);

         doc.newPage();

         OutputPanelPage(doc, rectPageSize);

         doc.close();
         return true;
       }
       catch (FileNotFoundException e)
       {
         e.printStackTrace();
         JOptionPane.showMessageDialog(null, e, "错误", 0);
         return false;
       }
       catch (DocumentException e) {
         e.printStackTrace();
         return false;
       }
       catch (IOException e) {
         e.printStackTrace();
       }return false;
     }

     public void OutputFramePage(Document doc, Rectangle rectPageSize)
     {
       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 10.0F, 0);
         Font fontChinese18 = new Font(bfChinese, 24.0F, 1);
         PdfPTable table = new PdfPTable(3);
         table.setWidthPercentage(100.0F);
         float[] widths = { 0.4F, 0.4F, 0.2F };
         table.setWidths(widths);
         Paragraph para = new Paragraph();
         para.add(new Chunk("制造单号: ", fontChinese));
         para.add(new Chunk(ResultInfoByPass.this.m_OrderInfo.GetOrderIndex(), fontChinese18));
         PdfPCell cell = new PdfPCell();
         cell.addElement(para);
         para = new Paragraph("");
         cell.addElement(para);

         Date orderDate = ResultInfoByPass.this.m_OrderInfo.GetOrderDate();
         DateFormat dtformat = new SimpleDateFormat("yyyy年MM月dd日");
         cell.addElement(new Paragraph(new Phrase("下单日期：" + dtformat.format(orderDate), fontChinese)));

         Date deliverDate = new Date(orderDate.getTime() + 691200000L);
         cell.addElement(new Paragraph("交货日期：" + dtformat.format(deliverDate), fontChinese));
         table.addCell(cell);

         String pipeIndex = ResultInfoByPass.this.m_OrderInfo.GetPipeIndex();
         String windowIndex = ResultInfoByPass.this.m_OrderInfo.GetWindowIndex();
         String windowNum = ResultInfoByPass.this.m_OrderInfo.GetWindowNum();
         String singleWindowIndex = pipeIndex + "-" + windowIndex + "/" + windowNum;
         cell = new PdfPCell();
         cell.addElement(new Paragraph("制造厂： 欣成木业", fontChinese));
         para = new Paragraph("");
         cell.addElement(para);

         para = new Paragraph();
         para.add(new Chunk("单窗制造单: ", fontChinese));
         Chunk tmp = new Chunk(singleWindowIndex, fontChinese18);
         tmp.setTextRise(-8.0F);
         para.add(tmp);

         cell.addElement(para);
         table.addCell(cell);
         System.out.println("windowIndex=" + singleWindowIndex);

         fontChinese = new Font(bfChinese, 10.0F, 0);
         int year = Calendar.getInstance().get(1);
         int month = Calendar.getInstance().get(2);
         int date = Calendar.getInstance().get(5);
         int hour = Calendar.getInstance().get(11);
         int minute = Calendar.getInstance().get(12);
         String dateprn = Integer.toString(year) + "-" + Integer.toString(month + 1) + "-" + Integer.toString(date);
         cell = new PdfPCell();

         cell.addElement(new Paragraph("打印日期 " + dateprn, fontChinese));
         cell.addElement(new Paragraph("打印时间 " + Integer.toString(hour) + ":" + Integer.toString(minute), fontChinese));
         table.addCell(cell);
         System.out.println("打印日期" + dateprn);

         doc.add(table);
       }
       catch (FileNotFoundException e)
       {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }

       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 10.0F, 0);
         Font fontChinese26 = new Font(bfChinese, 26.0F, 1);

         PdfPTable outTable = new PdfPTable(2);

         outTable.setWidthPercentage(100.0F);
         float[] outTableWidths = { 0.4F, 0.6F };
         outTable.setWidths(outTableWidths);

         PdfPTable table = new PdfPTable(2);
         table.getDefaultCell().setBorder(0);
         table.setWidthPercentage(30.0F);
         float[] tableWidth = { 0.5F, 0.5F };
         table.setWidths(tableWidth);
         table.setHorizontalAlignment(0);

         PdfPCell cell = new PdfPCell();
         cell.addElement(new Paragraph("经销商(Dealer)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String clientRegion = ResultInfoByPass.this.m_OrderInfo.GetClientRegion();
         cell.addElement(new Paragraph(clientRegion, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("客户标签(Customer)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String custRefNum = ResultInfoByPass.this.m_OrderInfo.getCustRefNum();
         cell.addElement(new Paragraph(custRefNum, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("房间(Room)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String room = ResultInfoByPass.this.m_OrderInfo.GetRoom();
         cell.addElement(new Paragraph(room, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("窗号(Line number)#", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(ResultInfoByPass.this.m_OrderInfo.GetWindowIndex(), fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("颜色(Color)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String color = ResultInfoByPass.this.m_OrderInfo.GetColor();
         cell.addElement(new Paragraph(color, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("同轨道上两扇", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String strConnected = "不相连";
         if (ResultInfoByPass.this.m_OrderInfo.IsPanelConnected() == true) {
           strConnected = "相连";
         }
         cell.addElement(new Paragraph(strConnected, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("合页颜色", fontChinese));
         cell.addElement(new Paragraph("(Color of hinge)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         int hingeColor = ResultInfoByPass.this.m_OrderInfo.GetHingeColor();
         String strHingeColor = Constants.HINGECOLOR[hingeColor] + "(" + Constants.HINGECOLOR_EN[hingeColor].replaceAll("_", " ") + ")";

         cell.addElement(new Paragraph(strHingeColor, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("宽(Width)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String oriWindowWidth = ResultInfoByPass.this.m_OrderInfo.GetOriWindowWidth();
         cell.addElement(new Paragraph(oriWindowWidth, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("高(Height)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String oriWindowHeight = ResultInfoByPass.this.m_OrderInfo.GetOriWindowHeight();
         cell.addElement(new Paragraph(oriWindowHeight, fontChinese));
         table.addCell(cell);
         outTable.addCell(table);

         cell = new PdfPCell();
         Paragraph para = new Paragraph();
         para = new Paragraph();
         cell.addElement(para);
         para = new Paragraph("外框部分", fontChinese26);
         para.setAlignment(1);
         cell.addElement(para);
         para = new Paragraph("ByPass/滑轨型", fontChinese26);
         para.setAlignment(1);
         cell.addElement(para);

         outTable.addCell(cell);

         doc.add(outTable);
       }
       catch (FileNotFoundException e)
       {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }

       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 8.0F, 0);
         Font boldFontChinese = new Font(bfChinese, 8.0F, 1);
         PdfPTable table = new PdfPTable(6);
         table.setWidthPercentage(100.0F);
         table.setHorizontalAlignment(0);
         float[] widths = { 0.24F, 0.17F, 0.09F, 0.11F, 0.14F, 0.25F };
         table.setWidths(widths);

         PdfPCell cell = new PdfPCell();
         cell.addElement(new Paragraph("部件", boldFontChinese));
         cell.addElement(new Paragraph("(Components)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("部件代号", boldFontChinese));
         cell.addElement(new Paragraph("(Components code)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("数量", boldFontChinese));
         cell.addElement(new Paragraph("(Number)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("长(单位mm)", boldFontChinese));
         cell.addElement(new Paragraph("(Length)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("宽(高)(单位mm)", boldFontChinese));
         cell.addElement(new Paragraph("(Width)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("备注", boldFontChinese));
         cell.addElement(new Paragraph("(Remark)", boldFontChinese));
         table.addCell(cell);

         DecimalFormat nFormat = new DecimalFormat();
         nFormat.setMaximumFractionDigits(2);
         nFormat.setGroupingSize(10);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("Header/顶板", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String strBeamType = Constants.BEAMCODE[1][ResultInfoByPass.this.m_OrderInfo.GetWoodOption()];
         cell.addElement(new Paragraph(strBeamType, fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("1", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_HeaderLength), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("108", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("Side Leg/边腿", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(strBeamType, fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("2", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_SideLegHeight), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("108", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("L Frame/L型外框", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();

         int woodOption = ResultInfoByPass.this.m_OrderInfo.GetWoodOption();
         String frameDescription = Constants.FRAMECODE[4][woodOption];

         cell.addElement(new Paragraph(frameDescription, fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("1", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_TrackLength), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("Track/轨道", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(Constants.TRACK[0], fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(ResultInfoByPass.this.m_OrderInfo.getTrackNum(), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_TrackLength), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("Top Fascia/面板", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(Constants.FASCIA[0], fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("1", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_TopFasciaLength), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("Side Fascia/边板", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(Constants.FASCIA[1], fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("2", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_SideFasciaHeight), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("", fontChinese));
         table.addCell(cell);

         if (ResultInfoByPass.this.m_OrderInfo.GetInstall().equalsIgnoreCase(Constants.INSTALL[1])) {
           cell = new PdfPCell();
           cell.addElement(new Paragraph("Corner Fascia/角板", fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(Constants.FASCIA[2], fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph("2", fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph("108", fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph("", fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph("", fontChinese));
           table.addCell(cell);
         }

         doc.add(table);
       }
       catch (FileNotFoundException e)
       {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }

       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 10.0F, 0);
         PdfPTable table = new PdfPTable(1);
         table.setWidthPercentage(100.0F);
         table.setHorizontalAlignment(0);

         DecimalFormat nFormat = new DecimalFormat();
         nFormat.setMaximumFractionDigits(2);
         nFormat.setGroupingSize(10);

         PdfPCell cell = new PdfPCell();

         cell.addElement(new Paragraph("轨道长： mm/毫米: " + nFormat.format(ResultInfoByPass.this.m_TrackLength), fontChinese));
         table.addCell(cell);

         doc.add(table);
       }
       catch (FileNotFoundException e) {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }

       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 10.0F, 0);
         PdfPTable table = new PdfPTable(3);
         String comments = ResultInfoByPass.this.m_OrderInfo.GetComments();
         System.out.println("the comments are: " + comments);
         if ((comments == null) || (comments.equals(""))) {
           return;
         }
         doc.add(new Paragraph("备注", fontChinese));

         String[] strComments = comments.split("@@");
		   int rowNum = strComments.length % (Constants.TABLESIZE[1] - 1) == 0 ? strComments.length / (Constants.TABLESIZE[1] - 1) : strComments.length / (Constants.TABLESIZE[1] - 1) + 1;

         for (int i = 0; i < rowNum; i++)
         {
           for (int j = 0; j < Constants.TABLESIZE[1] - 1; j++)
           {
             if (i * (Constants.TABLESIZE[1] - 1) + j < strComments.length)
             {
               PdfPCell cell = new PdfPCell();
               cell.addElement(new Paragraph(strComments[(i * (Constants.TABLESIZE[1] - 1) + j)], fontChinese));
               table.addCell(cell);
             }
             else
             {
               PdfPCell cell = new PdfPCell();
               cell.addElement(new Paragraph(""));
               table.addCell(cell);
             }
           }
         }
         doc.add(table);
       }
       catch (FileNotFoundException e)
       {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }
     }

     public void OutputPanelPage(Document doc, Rectangle rectPageSize)
     {
       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 10.0F, 0);
         Font fontChinese18 = new Font(bfChinese, 24.0F, 1);
         PdfPTable table = new PdfPTable(3);
         table.setWidthPercentage(100.0F);
         float[] widths = { 0.4F, 0.4F, 0.2F };
         table.setWidths(widths);
         Paragraph para = new Paragraph();
         para.add(new Chunk("制造单号: ", fontChinese));
         para.add(new Chunk(ResultInfoByPass.this.m_OrderInfo.GetOrderIndex(), fontChinese18));
         PdfPCell cell = new PdfPCell();
         cell.addElement(para);
         para = new Paragraph("");
         cell.addElement(para);

         Date orderDate = ResultInfoByPass.this.m_OrderInfo.GetOrderDate();
         DateFormat dtformat = new SimpleDateFormat("yyyy年MM月dd日");
         cell.addElement(new Paragraph(new Phrase("下单日期：" + dtformat.format(orderDate), fontChinese)));

         Date deliverDate = new Date(orderDate.getTime() + 691200000L);
         cell.addElement(new Paragraph("交货日期：" + dtformat.format(deliverDate), fontChinese));
         table.addCell(cell);

         String pipeIndex = ResultInfoByPass.this.m_OrderInfo.GetPipeIndex();
         String windowIndex = ResultInfoByPass.this.m_OrderInfo.GetWindowIndex();
         String windowNum = ResultInfoByPass.this.m_OrderInfo.GetWindowNum();
         String singleWindowIndex = pipeIndex + "-" + windowIndex + "/" + windowNum;
         cell = new PdfPCell();
         cell.addElement(new Paragraph("制造厂： 欣成木业", fontChinese));
         para = new Paragraph("");
         cell.addElement(para);

         para = new Paragraph();
         para.add(new Chunk("单窗制造单: ", fontChinese));
         Chunk tmp = new Chunk(singleWindowIndex, fontChinese18);
         tmp.setTextRise(-8.0F);
         para.add(tmp);

         cell.addElement(para);
         table.addCell(cell);
         System.out.println("windowIndex=" + singleWindowIndex);

         fontChinese = new Font(bfChinese, 10.0F, 0);
         int year = Calendar.getInstance().get(1);
         int month = Calendar.getInstance().get(2);
         int date = Calendar.getInstance().get(5);
         int hour = Calendar.getInstance().get(11);
         int minute = Calendar.getInstance().get(12);
         String dateprn = Integer.toString(year) + "-" + Integer.toString(month + 1) + "-" + Integer.toString(date);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("打印日期 " + dateprn, fontChinese));
         cell.addElement(new Paragraph("打印时间 " + Integer.toString(hour) + ":" + Integer.toString(minute), fontChinese));
         table.addCell(cell);
         System.out.println("打印日期" + dateprn);

         doc.add(table);
       }
       catch (FileNotFoundException e)
       {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }

       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 10.0F, 0);
         Font fontChinese32 = new Font(bfChinese, 26.0F, 1);

         PdfPTable OutTable = new PdfPTable(2);

         OutTable.setWidthPercentage(100.0F);
         float[] widths = { 0.4F, 0.6F };
         OutTable.setWidths(widths);

         PdfPTable table = new PdfPTable(2);
         table.getDefaultCell().setBorder(0);
         table.setWidthPercentage(30.0F);
         float[] newWidths = { 0.5F, 0.5F };
         table.setWidths(newWidths);
         table.setHorizontalAlignment(0);

         PdfPCell cell = new PdfPCell();
         cell.addElement(new Paragraph("经销商(Dealer)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String clientRegion = ResultInfoByPass.this.m_OrderInfo.GetClientRegion();
         cell.addElement(new Paragraph(clientRegion, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("客户标签(Customer)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String custRefNum = ResultInfoByPass.this.m_OrderInfo.getCustRefNum();
         cell.addElement(new Paragraph(custRefNum, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("房间(Room)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String room = ResultInfoByPass.this.m_OrderInfo.GetRoom();
         cell.addElement(new Paragraph(room, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("窗号(Line number)#", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(ResultInfoByPass.this.m_OrderInfo.GetWindowIndex(), fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("颜色(Color)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String color = ResultInfoByPass.this.m_OrderInfo.GetColor();
         cell.addElement(new Paragraph(color, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("同轨道上两扇", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String strConnected = "不相连";
         if (ResultInfoByPass.this.m_OrderInfo.IsPanelConnected() == true) {
           strConnected = "相连";
         }
         cell.addElement(new Paragraph(strConnected, fontChinese));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("合页颜色", fontChinese));
         cell.addElement(new Paragraph("(Color of hinge)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         int hingeColor = ResultInfoByPass.this.m_OrderInfo.GetHingeColor();
         String strHingeColor = Constants.HINGECOLOR[hingeColor] + "(" + Constants.HINGECOLOR_EN[hingeColor].replaceAll("_", " ") + ")";

         cell.addElement(new Paragraph(strHingeColor, fontChinese));
         table.addCell(cell);

         OutTable.addCell(table);

         cell = new PdfPCell();
         Paragraph para = new Paragraph();
         para = new Paragraph();
         cell.addElement(para);
         para = new Paragraph("窗扇部分", new Font(bfChinese, 30.0F, 0));
         para.setAlignment(1);
         cell.addElement(para);
         para = new Paragraph("ByPass/滑轨型", new Font(bfChinese, 30.0F, 0));
         para.setAlignment(1);
         cell.addElement(para);

         int pullBarType = ResultInfoByPass.this.m_OrderInfo.GetPullBarType();
         String strPullBarType;
         String strPullBarDes;
         if (pullBarType == 0) {
            strPullBarDes = "普通拉杆(Tilt rod)";
           strPullBarType = Constants.PULLBAR[ResultInfoByPass.this.m_OrderInfo.GetWoodOption()];
         }
         else
         {
           if (pullBarType == 1) {
           	strPullBarDes = "隐式拉杆(Hidden tilt rod)";
             strPullBarType = Constants.ALUMBAR[ResultInfoByPass.this.m_OrderInfo.GetVaneType()];
           }
           else {
             strPullBarDes = "偏拉杆";
             strPullBarType = Constants.PULLBAR[ResultInfoByPass.this.m_OrderInfo.GetWoodOption()];
           }
         }
         para = new Paragraph(strPullBarDes + "   " + strPullBarType, fontChinese32);
         para.setAlignment(1);
         cell.addElement(para);

         OutTable.addCell(cell);

         doc.add(OutTable);
       }
       catch (FileNotFoundException e)
       {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }

       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 8.0F, 0);
         Font boldFontChinese = new Font(bfChinese, 8.0F, 1);
         PdfPTable table = new PdfPTable(6);
         table.setWidthPercentage(100.0F);
         table.setHorizontalAlignment(0);
         float[] widths = { 0.24F, 0.17F, 0.09F, 0.11F, 0.14F, 0.25F };
         table.setWidths(widths);

         PdfPCell cell = new PdfPCell();
         cell.addElement(new Paragraph("部件", boldFontChinese));
         cell.addElement(new Paragraph("(Components)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("部件代号", boldFontChinese));
         cell.addElement(new Paragraph("(Components code)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("数量", boldFontChinese));
         cell.addElement(new Paragraph("(Number)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("长(单位mm)", boldFontChinese));
         cell.addElement(new Paragraph("(Length)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("宽(高)(单位mm)", boldFontChinese));
         cell.addElement(new Paragraph("(Width)", boldFontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("备注", boldFontChinese));
         cell.addElement(new Paragraph("(Remark)", boldFontChinese));
         table.addCell(cell);

         DecimalFormat nFormat = new DecimalFormat();
         nFormat.setMaximumFractionDigits(2);
         nFormat.setGroupingSize(10);

         int woodOption = ResultInfoByPass.this.m_OrderInfo.GetWoodOption();
         cell = new PdfPCell();
         cell.addElement(new Paragraph("立杆(Stile)", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String poleType = Constants.STILECODE[1][woodOption];
         cell.addElement(new Paragraph(poleType, fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         int poleNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPoleNum());
         cell.addElement(new Paragraph(Integer.toString(poleNum), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_PoleLength), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(""));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(""));
         table.addCell(cell);

         String upBeamCode = "";
         if (ResultInfoByPass.this.m_UpBeamWidth <= 101.6F) {
           upBeamCode = Constants.BEAMCODE[0][woodOption];
         }
         else if ((ResultInfoByPass.this.m_UpBeamWidth > 101.6F) && (ResultInfoByPass.this.m_UpBeamWidth <= 127.0F))
         {
           upBeamCode = Constants.BEAMCODE[1][woodOption];
         }
         else if ((ResultInfoByPass.this.m_UpBeamWidth > 127.0F) && (ResultInfoByPass.this.m_UpBeamWidth <= 152.39999F)) {
           upBeamCode = Constants.BEAMCODE[2][woodOption];
         }
         String downBeamCode = "";
         if (ResultInfoByPass.this.m_DownBeamWidth <= 101.6F) {
           downBeamCode = Constants.BEAMCODE[0][woodOption];
         }
         else if ((ResultInfoByPass.this.m_DownBeamWidth > 101.6F) && (ResultInfoByPass.this.m_DownBeamWidth <= 127.0F))
         {
           downBeamCode = Constants.BEAMCODE[1][woodOption];
         }
         else if ((ResultInfoByPass.this.m_DownBeamWidth > 127.0F) && (ResultInfoByPass.this.m_DownBeamWidth <= 152.39999F)) {
           upBeamCode = Constants.BEAMCODE[2][woodOption];
         }
         if (ResultInfoByPass.this.m_UpBeamWidth == ResultInfoByPass.this.m_DownBeamWidth)
         {
           cell = new PdfPCell();
           cell.addElement(new Paragraph("横梁(Rail)", fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(upBeamCode, fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(Integer.toString(ResultInfoByPass.this.m_UpBeamNum + ResultInfoByPass.this.m_DownBeamNum), fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_BeamLength), fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_UpBeamWidth), fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
         }
         else
         {
           cell = new PdfPCell();
           cell.addElement(new Paragraph("上横梁(Top rail)", fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(upBeamCode, fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(Integer.toString(ResultInfoByPass.this.m_UpBeamNum), fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_BeamLength), fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_UpBeamWidth), fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph("下横梁(Bottom rail)", fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(downBeamCode, fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(Integer.toString(ResultInfoByPass.this.m_DownBeamNum), fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_BeamLength), fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_DownBeamWidth), fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
         }

         int vaneType = ResultInfoByPass.this.m_OrderInfo.GetVaneType();

         if (!ResultInfoByPass.this.m_OrderInfo.getIsBoard())
         {
           cell = new PdfPCell();
           cell.addElement(new Paragraph("叶片(Louver)", fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           String strVaneType = Constants.VANECODE[vaneType][woodOption];
           cell.addElement(new Paragraph(strVaneType, fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(Integer.toString(ResultInfoByPass.this.m_VaneNum), fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_VaneLength), fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);

           int dividerNum = 0;
           if (ResultInfoByPass.this.m_DividerPos != null)
           {
             dividerNum = ResultInfoByPass.this.m_DividerPos.length;
           }
           Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetDividerNum());
           int pullBarType = ResultInfoByPass.this.m_OrderInfo.GetPullBarType();
           String strPullBarType;
           if ((pullBarType == 0) || (pullBarType == 2)) {
             strPullBarType = Constants.PULLBAR[woodOption];
           }
           else {
             strPullBarType = Constants.ALUMBAR[vaneType];
           }
           int loop = 0;
           do {
             cell = new PdfPCell();
             cell.addElement(new Paragraph("拉杆(Tilt rod)" + Integer.toString(loop), fontChinese));
             table.addCell(cell);
             cell = new PdfPCell();
             cell.addElement(new Paragraph(strPullBarType, fontChinese));
             table.addCell(cell);
             cell = new PdfPCell();
             int pullBarNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum());
             cell.addElement(new Paragraph(Integer.toString(pullBarNum), fontChinese));
             table.addCell(cell);
             cell = new PdfPCell();

             cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_PullBarLength[loop]), fontChinese));
             table.addCell(cell);
             cell = new PdfPCell();
             cell.addElement(new Paragraph(""));
             table.addCell(cell);
             cell = new PdfPCell();
             cell.addElement(new Paragraph(""));
             table.addCell(cell);

             loop++;
           }
           while (loop <= dividerNum);

           int dividerType = ResultInfoByPass.this.m_OrderInfo.GetDividerType();
           String strDividerType = "";
           if (dividerNum != 0) {
             strDividerType = Constants.DIVIDERBEAMCODE[dividerType][woodOption];
           }
           if (dividerNum > 0)
           {
             cell = new PdfPCell();
             cell.addElement(new Paragraph("分隔梁(Divider rail)", fontChinese));
             table.addCell(cell);

             cell = new PdfPCell();
             cell.addElement(new Paragraph(strDividerType, fontChinese));
             table.addCell(cell);

             cell = new PdfPCell();
             int cnt = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum()) * dividerNum;
             cell.addElement(new Paragraph(Integer.toString(cnt), fontChinese));
             table.addCell(cell);

             cell = new PdfPCell();
             cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_DividerLength), fontChinese));
             table.addCell(cell);

             cell = new PdfPCell();
             cell.addElement(new Paragraph(""));
             table.addCell(cell);

             cell = new PdfPCell();

             String dividerDesc = "";
             int tempVaneNum = 0;
             for (int i = 0; i < dividerNum; i++) {
               tempVaneNum += ResultInfoByPass.this.m_DividerPos[i];
               dividerDesc = "/" + Integer.toString(ResultInfoByPass.this.m_DividerPos[i]) + dividerDesc;
             }
             int leftVaneNum = ResultInfoByPass.this.m_VaneNum / Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum()) - tempVaneNum;
             dividerDesc = "分隔梁的位置为(Divider rail's position)：" + Integer.toString(leftVaneNum) + dividerDesc;
             cell.addElement(new Paragraph(dividerDesc, fontChinese));
             table.addCell(cell);
           }

         }
         else
         {
           cell = new PdfPCell();
           cell.addElement(new Paragraph("实木", fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph("BOARD", fontChinese));
           table.addCell(cell);

           int boardNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum());
           cell = new PdfPCell();
           cell.addElement(new Paragraph(Integer.toString(boardNum), fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_BoardWidth), fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(nFormat.format(ResultInfoByPass.this.m_BoardHeight), fontChinese));
           table.addCell(cell);

           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
         }

         if (ResultInfoByPass.this.m_DoubleHingeNum > 0) {
           cell = new PdfPCell();
           cell.addElement(new Paragraph("双开合页", fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(Constants.HINGECODE[1], fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(Integer.toString(ResultInfoByPass.this.m_DoubleHingeNum), fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
         }

         if (ResultInfoByPass.this.m_VaneBoltNum > 0)
         {
           cell = new PdfPCell();
           cell.addElement(new Paragraph("叶片销", fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph("PC1PIN", fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(Integer.toString(ResultInfoByPass.this.m_VaneBoltNum), fontChinese));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
           cell = new PdfPCell();
           cell.addElement(new Paragraph(""));
           table.addCell(cell);
         }

         cell = new PdfPCell();
         cell.addElement(new Paragraph("木榫", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         String tenonCode = "WDDOWEL";
         cell.addElement(new Paragraph(tenonCode, fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(Integer.toString(ResultInfoByPass.this.m_TenonNum), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(""));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(""));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(""));
         table.addCell(cell);

         cell = new PdfPCell();
         cell.addElement(new Paragraph("Roller/轨道车", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph("PCROLLER", fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(Integer.toString(ResultInfoByPass.this.m_RollerNum), fontChinese));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(""));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(""));
         table.addCell(cell);
         cell = new PdfPCell();
         cell.addElement(new Paragraph(""));
         table.addCell(cell);

         doc.add(table);
       }
       catch (FileNotFoundException e) {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }

       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 10.0F, 0);
         PdfPTable table = new PdfPTable(1);
         table.setWidthPercentage(100.0F);
         table.setHorizontalAlignment(0);

         NumberFormat nFormat = NumberFormat.getNumberInstance();
         nFormat.setMaximumFractionDigits(2);

         PdfPCell cell = new PdfPCell();

         cell.addElement(new Paragraph("总计： 平方米: " + nFormat.format(ResultInfoByPass.this.m_TotalArea / 1000000.0F), fontChinese));
         table.addCell(cell);

         doc.add(table);
       }
       catch (FileNotFoundException e) {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }
       try
       {
         BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
         Font fontChinese = new Font(bfChinese, 10.0F, 0);
         PdfPTable table = new PdfPTable(3);
         String comments = ResultInfoByPass.this.m_OrderInfo.GetComments();
         System.out.println("the comments are: " + comments);
         if ((comments == null) || (comments.equals(""))) {
           return;
         }
         doc.add(new Paragraph("备注", fontChinese));

         String[] strComments = comments.split("@@");
		   int rowNum = strComments.length % (Constants.TABLESIZE[1] - 1) == 0 ? strComments.length / (Constants.TABLESIZE[1] - 1) : strComments.length / (Constants.TABLESIZE[1] - 1) + 1;

         for (int i = 0; i < rowNum; i++)
         {
           for (int j = 0; j < Constants.TABLESIZE[1] - 1; j++)
           {
             if (i * (Constants.TABLESIZE[1] - 1) + j < strComments.length)
             {
               PdfPCell cell = new PdfPCell();
               cell.addElement(new Paragraph(strComments[(i * (Constants.TABLESIZE[1] - 1) + j)], fontChinese));
               table.addCell(cell);
             }
             else
             {
               PdfPCell cell = new PdfPCell();
               cell.addElement(new Paragraph(""));
               table.addCell(cell);
             }
           }
         }
         doc.add(table);
       }
       catch (FileNotFoundException e)
       {
         e.printStackTrace();
       }
       catch (DocumentException e) {
         e.printStackTrace();
       }
       catch (IOException e) {
         e.printStackTrace();
       }
     }
   }

   public class CalculateRectSimple
   {
     public CalculateRectSimple()
     {
     }

     public boolean Exec()
     {
       calculateHeaderLengthTrackLength();
       calculateTopFasciaLength();
       calculateSideLegHeight();
       calculateSideFasciaHeight();
       calculatePoleDuiKouPoleLength();
       if (!calculateBeamLength()) {
         return false;
       }
       calVaneLength();
       if (!calculateVaneNumBeamWidth())
         return false;
       calBeamNum();
       if (!calDividerPos())
         return false;
       calPullBarLength();
       calDividerLength();
       calBoardWidthAndHeight();
       if (!calHingeNum())
         return false;
       calVaneBoltNum();
       calTenonNum();
       CalRollerNum();
       return true;
     }

     public void calculateHeaderLengthTrackLength()
     {
       //ResultInfoByFold.access$002(ResultInfoByPass.this, Float.parseFloat(ResultInfoByPass.this.m_OrderInfo.GetOriWindowWidth()));

       //ResultInfoByFold.access$102(ResultInfoByPass.this, ResultInfoByPass.this.m_HeaderLength - 53.98F);
     }

     public void calculateTopFasciaLength()
     {
       //ResultInfoByFold.access$202(ResultInfoByPass.this, ResultInfoByPass.this.m_HeaderLength);
     }

     public void calculateSideLegHeight()
     {
       //ResultInfoByFold.access$302(ResultInfoByPass.this, Float.parseFloat(ResultInfoByPass.this.m_OrderInfo.GetOriWindowHeight()) - 25.4F);
     }

     public void calculateSideFasciaHeight()
     {
       //ResultInfoByFold.access$402(ResultInfoByPass.this, ResultInfoByPass.this.m_SideLegHeight - 38.099998F);
     }

     public void calculatePoleDuiKouPoleLength()
     {
       //ResultInfoByFold.access$502(ResultInfoByPass.this, ResultInfoByPass.this.m_SideLegHeight - 66.68F);
     }

     public boolean calculateBeamLength()
     {
       int poleNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPoleNum());
       int panelNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum());
       int trackNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.getTrackNum());
       float gap = 0.0F;
       if (trackNum == 2)
       {
         switch (panelNum) {
         case 2:
           gap = 20.0F;
           break;
         case 4:
           if (ResultInfoByPass.this.m_OrderInfo.IsPanelConnected())
           {
             gap = 20.0F;
           }
           else
           {
             gap = 20.0F;
           }
           break;
         case 6:
           if (ResultInfoByPass.this.m_OrderInfo.IsPanelConnected())
           {
             gap = 20.0F;
           }
           else
           {
             gap = 50.0F;
           }
           break;
         case 8:
           if (ResultInfoByPass.this.m_OrderInfo.IsPanelConnected())
           {
             gap = 40.0F;
           }
           else
           {
             gap = 70.0F;
           }case 3:
         case 5:
         case 7:
         }
       }
       else if (trackNum == 3)
       {
         switch (panelNum) {
         case 3:
           gap = 40.0F;
           break;
         case 6:
           if (ResultInfoByPass.this.m_OrderInfo.IsPanelConnected())
           {
             gap = 40.0F;
           }
           else
           {
             gap = 40.0F;
           }
           break;
         case 9:
           if (ResultInfoByPass.this.m_OrderInfo.IsPanelConnected())
           {
             gap = 40.0F;
           }
           else
           {
             gap = 80.0F;
           }
         }

       }
       else if (trackNum == 4)
       {
         switch (panelNum) {
         case 4:
           gap = 60.0F;
           break;
         case 6:
           if (ResultInfoByPass.this.m_OrderInfo.IsPanelConnected())
           {
             gap = 60.0F;
           }
           else
           {
             gap = 70.0F;
           }
         }
       }

       //ResultInfoByFold.access$602(ResultInfoByPass.this, (ResultInfoByPass.this.m_HeaderLength - gap - poleNum * 50.799999F) / panelNum);
       return true;
     }

     public void calVaneLength()
     {
       //ResultInfoByFold.access$702(ResultInfoByPass.this, ResultInfoByPass.this.m_BeamLength - 1.59F);
     }

     public boolean calculateVaneNumBeamWidth()
     {
       if (!ResultInfoByPass.this.m_OrderInfo.getIsBoard()) {
         float poleLength = ResultInfoByPass.this.m_PoleLength;
         int dividerNum = 0;
         float dividerWidth = 0.0F;
         if ((!CurtainChecker.isEmpty(ResultInfoByPass.this.m_OrderInfo.GetDividerNum())) && (Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetDividerNum()) > 0)) {
           dividerNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetDividerNum());
           dividerWidth = Float.parseFloat(Constants.DIVIDERTYPE[ResultInfoByPass.this.m_OrderInfo.GetDividerType()]);
         }
         else if (CurtainDesign.m_UserMainGUI.GetOrderInfo().getAutoAddDivider()) {
           int vaneType = ResultInfoByPass.this.m_OrderInfo.GetVaneType();
           if ((!CurtainChecker.isEmpty(ResultInfoByPass.this.m_OrderInfo.GetPoleNum())) && (Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPoleNum()) > 0))
           {
             if ((vaneType == 0) || (vaneType == 2)) {
               dividerWidth = Float.parseFloat(Constants.DIVIDERTYPE[2]);
               ResultInfoByPass.this.m_OrderInfo.SaveDividerType(2);
             }
             else if (vaneType == 1) {
               dividerWidth = Float.parseFloat(Constants.DIVIDERTYPE[0]);
               ResultInfoByPass.this.m_OrderInfo.SaveDividerType(0);
             }
             else if ((vaneType == 3) || (vaneType == 4))
             {
               dividerWidth = Float.parseFloat(Constants.DIVIDERTYPE[1]);
               ResultInfoByPass.this.m_OrderInfo.SaveDividerType(1);
             }
             else
             {
               dividerWidth = Float.parseFloat(Constants.DIVIDERTYPE[3]);
               ResultInfoByPass.this.m_OrderInfo.SaveDividerType(3);
             }

             if ((vaneType == 4) && (ResultInfoByPass.this.m_PoleLength >= 1100.0F))
             {
               dividerNum = 1;
             }
             if (((vaneType == 0) || (vaneType == 1) || (vaneType == 2) || (vaneType == 3)) && (ResultInfoByPass.this.m_PoleLength >= 1600.0F)) {
               dividerNum = 1;
             }
           }
         }

         float minBeamWidth = 0.0F;
         float tmpVaneNum = 0.0F;
         int vaneNum = 0;
         int vaneType = ResultInfoByPass.this.m_OrderInfo.GetVaneType();
         float vaneWidth = Float.parseFloat(Constants.VANETYPE[vaneType]);
         if (vaneType == 0) {
           minBeamWidth = 105.4F;
           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 12.7F);
           vaneNum = StrictMath.round(tmpVaneNum);
           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
         }
         else if (vaneType == 1) {
           minBeamWidth = 114.3F;
           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 12.7F);
           vaneNum = StrictMath.round(tmpVaneNum);
           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
         }
         else if (vaneType == 2) {
           minBeamWidth = 133.35001F;
           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 12.7F);
           vaneNum = StrictMath.round(tmpVaneNum);
           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
         }
         else if (vaneType == 3) {
           minBeamWidth = 100.0F;
           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 8.0F);
           vaneNum = StrictMath.round(tmpVaneNum);
           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 8.0F)) / 2.0F;
         }
         else if (vaneType == 4) {
           minBeamWidth = 87.5F;
           tmpVaneNum = (poleLength - dividerWidth * dividerNum - minBeamWidth * 2.0F) / (vaneWidth - 6.0F);
           vaneNum = StrictMath.round(tmpVaneNum);
           minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 6.0F)) / 2.0F;
         }

         if (vaneType == 0)
         {
           while (true) {
             if (minBeamWidth < 80.0F)
             {
               vaneNum--;
               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
               continue;
             }if (minBeamWidth <= 130.8F)
               break;
             vaneNum++;
             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
           }

           float halfVaneWidth = (vaneWidth - 12.7F) / 2.0F;

           if (minBeamWidth - halfVaneWidth >= 80.0F)
           {
             while (true)
             {
               minBeamWidth -= halfVaneWidth;
               vaneNum++;
               if (minBeamWidth - halfVaneWidth < 80.0F)
               {
                 break;
               }

             }

           }

           //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth);
           //ResultInfoByFold.access$902(ResultInfoByPass.this, minBeamWidth);
         }
         if (vaneType == 1)
         {
           while (true) {
             if (minBeamWidth < 76.199997F)
             {
               vaneNum--;
               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
               continue;
             }if (minBeamWidth <= 152.39999F)
               break;
             vaneNum++;
             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
           }

           float halfVaneWidth = (vaneWidth - 12.7F) / 2.0F;

           if (minBeamWidth - halfVaneWidth >= 76.199997F)
           {
             while (true)
             {
               minBeamWidth -= halfVaneWidth;
               vaneNum++;
               if (minBeamWidth - halfVaneWidth < 76.199997F)
               {
                 break;
               }

             }

           }

           //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth);
           //ResultInfoByFold.access$902(ResultInfoByPass.this, minBeamWidth);
         }
         if (vaneType == 2)
         {
           if ((minBeamWidth >= 114.3F) && (minBeamWidth <= 152.40000000000001D)) {
             //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth);
             //ResultInfoByFold.access$902(ResultInfoByPass.this, minBeamWidth);

             float halfVaneWidth = (vaneWidth - 12.7F) / 2.0F;

             if (minBeamWidth - halfVaneWidth >= 114.3F)
             {
               while (true)
               {
                 minBeamWidth -= halfVaneWidth;
                 vaneNum++;
                 if (minBeamWidth - halfVaneWidth < 114.3F)
                 {
                   break;
                 }
               }
             }
           }
           else if (minBeamWidth < 114.3F)
           {
             if (minBeamWidth * 2.0F > 114.3F) {
               //ResultInfoByFold.access$902(ResultInfoByPass.this, 114.3F);
               //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth * 2.0F - 114.3F);
             }
             else
             {
               do {
                 vaneNum--;
                 minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
                 if ((minBeamWidth >= 114.3F) && (minBeamWidth <= 152.39999F)) {
                   //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth);
                   //ResultInfoByFold.access$902(ResultInfoByPass.this, minBeamWidth);
                   break;
                 }
               }
               while ((minBeamWidth >= 114.3F) ||
                 (minBeamWidth * 2.0F <= 114.3F));
               //ResultInfoByFold.access$902(ResultInfoByPass.this, 114.3F);
               //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth * 2.0F - 114.3F);
             }

           }
           else
           {
             while (true)
             {
               vaneNum++;
               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 12.7F)) / 2.0F;
               if ((minBeamWidth >= 114.3F) && (minBeamWidth <= 152.39999F)) {
                 //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth);
                 //ResultInfoByFold.access$902(ResultInfoByPass.this, minBeamWidth);
               }
               else {
                 if (minBeamWidth >= 114.3F)
                   continue;
                 if (minBeamWidth * 2.0F > 114.3F) {
                   //ResultInfoByFold.access$902(ResultInfoByPass.this, 114.3F);
                   //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth * 2.0F - 114.3F);
                 }
                 else
                 {
                   //ResultInfoByFold.access$902(ResultInfoByPass.this, 114.3F);
                   //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth * 2.0F);
                 }
               }
             }
           }
         }

         if (vaneType == 3)
         {
           while (true) {
             if (minBeamWidth < 80.0F)
             {
               vaneNum--;
               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 8.0F)) / 2.0F;
               continue;
             }if (minBeamWidth <= 120.0F)
               break;
             vaneNum++;
             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 8.0F)) / 2.0F;
           }

           float halfVaneWidth = (vaneWidth - 8.0F) / 2.0F;

           if (minBeamWidth - halfVaneWidth >= 80.0F)
           {
             while (true)
             {
               minBeamWidth -= halfVaneWidth;
               vaneNum++;
               if (minBeamWidth - halfVaneWidth < 80.0F)
               {
                 break;
               }

             }

           }

           //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth + 2.3F);
           //ResultInfoByFold.access$902(ResultInfoByPass.this, minBeamWidth + 2.3F);
         }
         if (vaneType == 4)
         {
           while (true) {
             if (minBeamWidth < 75.0F)
             {
               vaneNum--;
               minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 6.0F)) / 2.0F;
               continue;
             }if (minBeamWidth <= 100.0F)
               break;
             vaneNum++;
             minBeamWidth = (poleLength - dividerWidth * dividerNum - vaneNum * (vaneWidth - 6.0F)) / 2.0F;
           }

           float halfVaneWidth = (vaneWidth - 6.0F) / 2.0F;

           if (minBeamWidth - halfVaneWidth >= 75.0F)
           {
             while (true)
             {
               minBeamWidth -= halfVaneWidth;
               vaneNum++;
               if (minBeamWidth - halfVaneWidth < 75.0F)
               {
                 break;
               }

             }

           }

           //ResultInfoByFold.access$802(ResultInfoByPass.this, minBeamWidth);
           //ResultInfoByFold.access$902(ResultInfoByPass.this, minBeamWidth);
         }

         //ResultInfoByFold.access$1002(ResultInfoByPass.this, vaneNum * Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum()));
       }
       else {
         //ResultInfoByFold.access$802(ResultInfoByPass.this, 100.0F);
         //ResultInfoByFold.access$902(ResultInfoByPass.this, 100.0F);
       }
       return true;
     }

     public void calBeamNum()
     {
       //ResultInfoByFold.access$1102(ResultInfoByPass.this, Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum()));
       //ResultInfoByFold.access$1202(ResultInfoByPass.this, ResultInfoByPass.this.m_UpBeamNum);
     }

     public boolean calDividerPos()
     {
       if (!ResultInfoByPass.this.m_OrderInfo.getIsBoard()) {
         int dividerNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetDividerNum());
         if (dividerNum == 0) {
           if (ResultInfoByPass.this.m_OrderInfo.getAutoAddDivider())
           {
             int vaneType = ResultInfoByPass.this.m_OrderInfo.GetVaneType();
             if (((vaneType == 0) || (vaneType == 1) || (vaneType == 2) || (vaneType == 3)) && (ResultInfoByPass.this.m_PoleLength >= 1600.0F))
             {
               if (ResultInfoByPass.this.m_VaneNum / Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum()) > 1)
               {
                 // int num = ResultInfoByPass.this.m_VaneNum % (2 * Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum())) == 0 ? ResultInfoByPass.this.m_VaneNum  (2 * Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum())) + 1;

                 // ResultInfoByPass.access$1302(ResultInfoByPass.this, new int[] { num });
               }

             }
             else if ((vaneType == 4) && (ResultInfoByPass.this.m_PoleLength >= 1100.0F))
             {
               if (ResultInfoByPass.this.m_VaneNum / Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum()) > 1)
               {
                 // int num = ResultInfoByPass.this.m_VaneNum % (2 * Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum())) == 0 ? ResultInfoByPass.this.m_VaneNum  (2 * Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum())) + 1;

                 // // ResultInfoByPass.access$1302(ResultInfoByPass.this, new int[] { num });
               }
             }
           }

           return true;
         }

         // ResultInfoByPass.access$1302(ResultInfoByPass.this, new int[dividerNum]);
         int vaneNum = ResultInfoByPass.this.m_VaneNum / Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum());
         int vaneType = ResultInfoByPass.this.m_OrderInfo.GetVaneType();
         float vaneWidth = Float.parseFloat(Constants.VANETYPE[vaneType]);
         String strPos = ResultInfoByPass.this.m_OrderInfo.GetDivederPos();
         String[] strPosTmp = strPos.split(",");

         float overlapSize = 0.0F;
         switch (vaneType)
         {
         case 0:
           overlapSize = 12.7F;
           break;
         case 1:
           overlapSize = 12.7F;
           break;
         case 2:
           overlapSize = 12.7F;
           break;
         case 3:
           overlapSize = 8.0F;
           break;
         case 4:
           overlapSize = 6.0F;
         }

         int downVaneNum = 0;
         float fDownVaneNum = 0.0F;
         float dividerWidth = Float.parseFloat(Constants.DIVIDERTYPE[ResultInfoByPass.this.m_OrderInfo.GetDividerType()]);
         for (int i = 0; i < dividerNum; i++) {
           if (i == 0)
           {
			   fDownVaneNum = (Float.parseFloat(strPosTmp[i]) - ResultInfoByPass.this.m_DownBeamWidth - dividerWidth / 2.0F - 24.0F) / (vaneWidth - overlapSize);
           }
           else {
             fDownVaneNum = (Float.parseFloat(strPosTmp[i]) - Float.parseFloat(strPosTmp[(i - 1)]) - dividerWidth) / (vaneWidth - overlapSize);
           }
           if (fDownVaneNum < 1.0F)
           {
             JOptionPane.showMessageDialog(null, "分隔梁位置太低，不合理，请检查", "错误", 0);
             return false;
           }
           if (fDownVaneNum > vaneNum - 1)
           {
             JOptionPane.showMessageDialog(null, "分隔梁位置太高，不合理，请检查", "错误", 0);
             return false;
           }
           downVaneNum = StrictMath.round(fDownVaneNum);
           ResultInfoByPass.this.m_DividerPos[i] = downVaneNum;
         }

         int aboveDivider = 0;
         int aboveVaneNum = 0;
         float height = 0.0F;
         float distance = 0.0F;
         for (int i = 0; i < dividerNum; i++) {
           aboveDivider = i;
           aboveVaneNum += ResultInfoByPass.this.m_DividerPos[i];

           height = aboveDivider * dividerWidth + dividerWidth / 2.0F + ResultInfoByPass.this.m_DownBeamWidth + aboveVaneNum * (vaneWidth - overlapSize);

           distance = height - Float.parseFloat(strPosTmp[i]);
           if (Math.abs(distance) > dividerWidth / 2.0F) {
             if (distance > 0.0F) {
               aboveVaneNum--;
               // ResultInfoByPass.this.m_DividerPos[i] = (//ResultInfoByPass.access$1300(ResultInfoByPass.this)[i] - 1);
               if (i != dividerNum - 1) {
				   // ResultInfoByPass.this.m_DividerPos[(i + 1)] = (//ResultInfoByPass.access$1300(ResultInfoByPass.this)[(i + 1)] + 1);
			   }
             }
             else
             {
               aboveVaneNum++;
               // ResultInfoByPass.this.m_DividerPos[i] = (//ResultInfoByPass.access$1300(ResultInfoByPass.this)[i] - 1);
               if (i == dividerNum - 1)
                 continue;
               // ResultInfoByPass.this.m_DividerPos[(i + 1)] = (//ResultInfoByPass.access$1300(ResultInfoByPass.this)[(i + 1)] - 1);
             }
           }
         }
       }

       return true;
     }

     public void calPullBarLength()
     {
       if (!ResultInfoByPass.this.m_OrderInfo.getIsBoard()) {
         int dividerNum = 0;
         if (ResultInfoByPass.this.m_DividerPos != null) {
           dividerNum = ResultInfoByPass.this.m_DividerPos.length;
         }
         //ResultInfoByPass.access$1402(ResultInfoByPass.this, new float[4]);
         int vaneType = ResultInfoByPass.this.m_OrderInfo.GetVaneType();
         float vaneWidth = Float.parseFloat(Constants.VANETYPE[vaneType]);
         int vaneNum = ResultInfoByPass.this.m_VaneNum / Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum());
         int pullBarType = ResultInfoByPass.this.m_OrderInfo.GetPullBarType();

         float overlapSize = 0.0F;
         switch (vaneType)
         {
         case 0:
           overlapSize = 12.7F;
           break;
         case 1:
           overlapSize = 12.7F;
           break;
         case 2:
           overlapSize = 12.7F;
           break;
         case 3:
           overlapSize = 8.0F;
           break;
         case 4:
           overlapSize = 6.0F;
         }

         if (pullBarType == 1)
         {
           int totalVaneNumDownLastDivider = 0;
           int i = 0;
           for (i = 0; i < dividerNum; i++) {
             int downVaneNum = ResultInfoByPass.this.m_DividerPos[i];
             ResultInfoByPass.this.m_PullBarLength[i] = ((vaneWidth - overlapSize) * (downVaneNum - 1) + 9.525F);
             totalVaneNumDownLastDivider += ResultInfoByPass.this.m_DividerPos[i];
           }

           int vaneNumUpLastDivider = vaneNum - totalVaneNumDownLastDivider;
           ResultInfoByPass.this.m_PullBarLength[i] = ((vaneWidth - overlapSize) * (vaneNumUpLastDivider - 1) + 9.525F);
         }
         else {
           int totalVaneNumDownLastDivider = 0;
           int i = 0;
           for (i = 0; i < dividerNum; i++) {
             int downVaneNum = ResultInfoByPass.this.m_DividerPos[i];
             ResultInfoByPass.this.m_PullBarLength[i] = ((vaneWidth - overlapSize) * (downVaneNum - 1) + 31.75F);
             totalVaneNumDownLastDivider += ResultInfoByPass.this.m_DividerPos[i];
           }

           int vaneNumUpLastDivider = vaneNum - totalVaneNumDownLastDivider;
           ResultInfoByPass.this.m_PullBarLength[i] = ((vaneWidth - overlapSize) * (vaneNumUpLastDivider - 1) + 31.75F);
         }
         return;
       }
     }

     public void calDividerLength()
     {
       //ResultInfoByPass.access$1502(ResultInfoByPass.this, ResultInfoByPass.this.m_BeamLength);
     }

     public void calBoardWidthAndHeight()
     {
       if (ResultInfoByPass.this.m_OrderInfo.getIsBoard())
       {
         //ResultInfoByPass.access$1602(ResultInfoByPass.this, ResultInfoByPass.this.m_PoleLength - (ResultInfoByPass.this.m_UpBeamWidth + ResultInfoByPass.this.m_DownBeamWidth) + 20.0F);
         //ResultInfoByPass.access$1702(ResultInfoByPass.this, ResultInfoByPass.this.m_BeamLength + 20.0F);
       }
     }

     public boolean calHingeNum()
     {
       int D = 0;
       if (ResultInfoByPass.this.m_PoleLength <= 1200.0F)
       {
         D = 2;
       }
       else if (ResultInfoByPass.this.m_PoleLength <= 2000.0F)
       {
         D = 3;
       }
       else if (ResultInfoByPass.this.m_PoleLength <= 2400.0F)
       {
         D = 4;
       }
       else if (ResultInfoByPass.this.m_PoleLength > 2400.0F)
       {
         D = 5;
       }

       int panelNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum());
       int doublePaneNum = 0;
       if (ResultInfoByPass.this.m_OrderInfo.IsPanelConnected() == true) {
         if (panelNum == 4) {
           doublePaneNum = 2;
         }
         else if (panelNum == 8) {
           doublePaneNum = 4;
         }
       }
       //ResultInfoByPass.access$1802(ResultInfoByPass.this, doublePaneNum * D);
       return true;
     }

     public void calVaneBoltNum()
     {
       //ResultInfoByPass.access$1902(ResultInfoByPass.this, ResultInfoByPass.this.m_VaneNum * 2);
     }

     public void calTenonNum()
     {
       int E = 0;
       if (ResultInfoByPass.this.m_DownBeamWidth < 127.0F)
       {
         E = 4;
       }
       else
       {
         E = 6;
       }

       int F = 4;
       int panelNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum());
       int dividerNum = 0;
       if (!CurtainChecker.isEmpty(ResultInfoByPass.this.m_OrderInfo.GetDividerNum()))
       {
         dividerNum = Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetDividerNum());
       }
       //ResultInfoByPass.access$2002(ResultInfoByPass.this, (E * 2 + F * dividerNum) * panelNum);
     }

     public void calTotalArea()
     {
       float origWinWidth = Float.parseFloat(ResultInfoByPass.this.m_OrderInfo.GetOriWindowWidth());
       float origWinHeight = Float.parseFloat(ResultInfoByPass.this.m_OrderInfo.GetOriWindowHeight());

       int frameNumPos = ResultInfoByPass.this.m_OrderInfo.GetFrameNumPos();
       if (frameNumPos == 2) {
         //ResultInfoByPass.access$2102(ResultInfoByPass.this, origWinWidth * origWinHeight);
       }
       else{
		   //ResultInfoByPass.access$2102(ResultInfoByPass.this, (origWinWidth + 80.0F) * (origWinHeight + 80.0F));
	   }
     }

     public void CalRollerNum()
     {
       //ResultInfoByPass.access$2202(ResultInfoByPass.this, Integer.parseInt(ResultInfoByPass.this.m_OrderInfo.GetPanelNum()) * 2);
     }
   }
 }

/* Location:           C:\Users\Administrator\Desktop\奥特百叶窗\Shutter DesignerV3.1\CurtainDesign.jar
 * Qualified Name:     CurtainDesign.ResultInfoByPass
 * JD-Core Version:    0.6.0
 */